package com.cdu.guoxinan.www.smartcom.service.impl;

import com.cdu.guoxinan.www.smartcom.domian.pojo.MedicalDoctor;
import com.cdu.guoxinan.www.smartcom.mapper.MedicalDoctorMapper;
import com.cdu.guoxinan.www.smartcom.service.MedicalDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class MedicalDoctorServiceImpl implements MedicalDoctorService {
    @Autowired
    private MedicalDoctorMapper medicalDoctorMapper;

    @Override
    public List<MedicalDoctor> findAll() {
        return medicalDoctorMapper.findAll();
    }

    @Override
    public MedicalDoctor findById(Long doctorId) {
        return medicalDoctorMapper.findById(doctorId);
    }

    @Override
    public boolean addDoctor(MedicalDoctor doctor) {
        return medicalDoctorMapper.insert(doctor) > 0;
    }
    @Override
    public boolean updateDoctor(MedicalDoctor doctor) {
        return medicalDoctorMapper.update(doctor) > 0;
    }
    @Override
    public boolean deleteDoctor(Long doctorId) {
        return medicalDoctorMapper.delete(doctorId) > 0;
    }
} 